@extends('layout.admin')

@section('content')
  
  <div class="clearfix"></div>
  
  <div class="col-md-10 " style='height:1000px'>
  @if (count($errors) > 0)
      <div class="alert alert-info">
              @foreach ($errors->all() as $error)
              <li>
                <img src="/admins/images/info.png" alt="">&nbsp;
                {{ $error }}</li>
              @endforeach
      </div>
  @endif
 

 <div class="panel-head"><strong class="icon-reorder"> 修改商品信息</strong></div>
  <form class="form-horizontal" role="form" action='/admin/goods/update' method='post' enctype='multipart/form-data' style='margin-left:0px'> 
        <!-- 商品名称 -->
        <div class="form-group" style='margin-bottom:20px;margin-top:30px'>
          <label class="col-sm-2 control-label">商品名称</label>
          <div class="col-sm-10">
              <input type="text" name='title' class="form-control" value='{{$goods->title}}'>
          </div>
        </div>
        <!-- 价格 -->
        <div class="form-group" style='margin-bottom:20px'>
          <label class="col-sm-2 control-label">价&nbsp;&nbsp;  &nbsp;&nbsp; 格</label>
          <div class="col-sm-10">
              <input type="text" name='price' class="form-control" value='{{$goods->price}}'>
          </div>
        </div>
        <!-- 库存 -->
        <div class="form-group" style='margin-bottom:20px'>
          <label  class="col-sm-2 control-label">库&nbsp;&nbsp;  &nbsp;&nbsp; 存</label>
              <div class="col-sm-10">
                <input type="number" name='kucun' style='width:770px' value='{{$goods->kucun}}'>
                <!-- <img src="/" alt=""> -->
              </div>
        </div>
        <!-- 分类标题 -->
        <div class="form-group" style='margin-bottom:20px'>
          <label  class="col-sm-2 control-label">分类标题</label>
              <div class="col-sm-10">
              <select name="cate_id" class="input w70" placeholder="修改服装分类">
                @foreach($cates as $k=>$v)
                <option value="{{$v->id}}" @if($goods->cate_id==$v->id) selected @endif>{{$v->name}}</option>
                @endforeach
               
            </select>
          </div>
        </div>
        <!-- 状态 -->
        <div class="form-group" style='margin-bottom:20px'>
          <label for="inputPassword3" class="col-sm-2 control-label">状&nbsp;&nbsp;  &nbsp;&nbsp; 态</label>
          <div style='margin-top:8px '>
              <label><input type="radio" name='status' value='1' @if($goods->status==1) checked @endif>上架</label> &nbsp;&nbsp; 
              <label><input type="radio" name='status' value='0' @if($goods->status==0) checked @endif>下架</label>
          </div>
      </div>
      <!-- 颜色 -->
        <div class="form-group" style='margin-bottom:20px;margin-left:8px'>
        <div class="col-sm-10 color">
            <label for="inputPassword4" class="col-sm-2 control-label">颜&nbsp;&nbsp;  &nbsp;&nbsp; 色</label>
              
                <input type="checkbox" name='color[]' value='红色' @foreach($goods->color as $k=>$v) @if($v == '红色') checked @endIf  @endForeach>红色
                <input type="checkbox" name='color[]' value='军绿色' @foreach($goods->color  as $k=>$v) @if($v == '军绿色') checked @endIf  @endForeach>军绿色
                <input type="checkbox" name='color[]' value='黑色' @foreach($goods->color  as $k=>$v) @if($v == '黑色') checked @endIf  @endForeach>黑色
                <input type="checkbox" name='color[]' value='灰色' @foreach($goods->color  as $k=>$v) @if($v == '灰色') checked @endIf  @endForeach>灰色
                <input type="checkbox" name='color[]' value='白色' @foreach($goods->color  as $k=>$v) @if($v == '白色') checked @endIf  @endForeach>白色
              
            </div>
        </div>
        <!-- 尺码 -->
        <div class="form-group" style='margin-bottom:20px;margin-left:8px'>
          <div class="col-sm-10 size">
            <label for="inputPassword4" class="col-sm-2 control-label">尺&nbsp;&nbsp;  &nbsp;&nbsp; 码</label>
                
                <input type="checkbox" name='size[]' value='S' @foreach($goods->size as $k=>$v) @if($v == 'S') checked @endif @endforeach>S
                <input type="checkbox" name='size[]' value='M'@foreach($goods->size as $k=>$v) @if($v == 'M') checked @endif @endforeach>M
                <input type="checkbox" name='size[]' value='L'@foreach($goods->size as $k=>$v) @if($v == 'L') checked @endif @endforeach>L
                <input type="checkbox" name='size[]' value='XL' @foreach($goods->size as $k=>$v) @if($v == 'XL') checked @endif @endforeach>XL
                <input type="checkbox" name='size[]' value='XXL' @foreach($goods->size as $k=>$v) @if($v == 'XXL') checked @endif @endforeach>XXL
                <input type="checkbox" name='size[]' value='XXXL' @foreach($goods->size as $k=>$v) @if($v == 'XXL') checked @endif @endforeach>XXXL
              
            </div>
        </div>
        <!-- 图像 -->
        
        <div class="mws-button-row" style='margin-left:300px '>
            {{csrf_field()}}
            <input type="hidden" name='id' value='{{$goods->id}}'>
            <input value="修改" class="btn btn-danger" type="submit" style='margin-right:30px;'>
            <input value="重置" class="btn " type="reset">
        </div>
    </form>
</div>
    
  </div>


@endsection